package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-08-28 15:57
 */
public class Test02 {
    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        System.out.println("是否开始游戏y/n");
//        String answer = sc.next();
//        while (answer.equals("y")) {
//            System.out.println("玩一把,游戏过程");
//            System.out.println("是否继续y/n");
//            answer = sc.next();
//        }
//        System.out.println("程序结束");


//        Scanner sc = new Scanner(System.in);
//        System.out.println("是否开始游戏y/n");
//        String answer = sc.next();
//        do{
//            if(!answer.equals("y")){
//                break;
//            }
//            System.out.println("玩一把,游戏过程");
//            System.out.println("是否继续y/n");
//            answer = sc.next();
//        }while(true);
//        System.out.println("程序结束");


        Scanner sc = new Scanner(System.in);
        System.out.println("是否开始游戏y/n");
//        String answer = sc.next();
//        for(;answer.equals("y");){
//            System.out.println("玩一把,游戏过程");
//            System.out.println("是否继续y/n");
//            answer = sc.next();
//        }
        String answer;
        for(answer = sc.next();answer.equals("y"); answer = sc.next()){
            System.out.println("玩一把,游戏过程");
            System.out.println("是否继续y/n");
        }

        System.out.println("程序结束");


    }
}
